#!/bin/bash

set -e

cd "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1

export readonly ARCH=${1:-x86_64}
export readonly NAME=${2:-$(basename "${PWD%/*}")}
export readonly VERSION=${3:-$(basename "$PWD")}

rm -rf opt/ 
mkdir -p opt/

cd opt
wget https://us.download.nvidia.com/XFree86/Linux-x86_64/535.86.05/NVIDIA-Linux-x86_64-535.86.05.run 

cd ..


cat <<'EOF' >"Kubefile"
FROM scratch
COPY opt opt
COPY scripts scripts
COPY entrypoint.sh engrypoint.sh
CMD ["bash entrypoint.sh"]
EOF
